<!DOCTYPE html>
<html>
<head>
    <include file="Public/head"/>
    <link href="__CSS__/main.css" rel="stylesheet" type="text/css" />
    <script src="__JS__/jquery-2.1.0.min.js"></script>

    <style>
        .order-bottom{

            line-height: 30px;
            padding: 10px 0;
        }
    </style>
</head>

<body>

<div id="page">
    <header id="header">
        <div class="header_l"> <a class="ico_10" href="javascript:history.go(-1);"> 返回 </a> </div>
        <h1> 确认订单 </h1>
    </header>
</div>
<div class="cart-step" id="J_cartTab">
    <ul>
        <li class="cur">1.确认订单</li>
        <li>2.下单成功</li>
    </ul>
</div>
<div class="blank3"></div>
<section class="wrap">
    <form action="{:U('Order/add')}" method="post" name="theForm" id="theForm" onSubmit="return checkOrderForm(this)">
        <script type="text/javascript">
            var flow_no_payment = "您必须选定一个支付方式。";
            var flow_no_shipping = "您必须选定一个配送方式。";
        </script>
        <section class="order_box padd1 radius10" style="padding-top:0">
            <div class="in">
                <div class="table_box table_box1">
                    <dl>
                        <dd class="w50">收货人姓名 <span class="f1">{$address.name}</span></dd>
                        <dd class="w50 c999">
                            <div class="ico_14"></div>
                            {$address.mobile} <a href="{:U('Address/select',array('cart_ids'=>arr2str($cart_ids)))}" class="modify radius5">修改</a></dd>
                    </dl>
                    <dl>
                        <dd class="w50 b_no" >详细地址 {$address.address} </dd>
                    </dl>
                    <input type="text" hidden="hidden" name="address_id" value="{$address.id}">
                </div>
            </div>
        </section>
        <div class="blank3"></div>
        <section class="order_box padd1 radius10" style="padding-top:0.3rem;padding-bottom:0.3rem;">
            <div class="table_box table_box2">
                <dl>
                    <dd class="dd1">配送方式 <span class="span1 radius5">必填</span></dd>
                    <dd class="dd2" id="selected1">请选择配送方式</dd>
                    <i></i>
                </dl>
                <div class="dl_box" id="shipping" style="display:block">
                    <p>
                        <!--<input name="deliver_type" type="radio" class="radio" id="deliver_type_0" value="0"  supportCod="1" insure="0" style="vertical-align:middle" /><label for="deliver_type_0"> 到店取货 [￥<span>0.00</span>]</label>-->
                        <input name="deliver_type" type="radio" class="radio" id="deliver_type_1" value="1" checked="checked" supportCod="1" insure="0" style="vertical-align:middle" /><label for="deliver_type_1"> 送货上门 [￥<span>0.00</span>]</label>
                    </p>
                    <!--  <input name="need_insure" id="ECS_NEEDINSURE" type="checkbox"  onclick="selectInsure(this.checked)" value="1"  disabled="true"  />
           配送是否需要保价-->
                </div>
                <dl>
                    <dd class="dd1">支付方式 <span class="span1 radius5">必填</span></dd>
                    <dd class="dd2 selectPayment" id="selected2">请选择支付方式</dd>
                    <i></i>
                </dl>
                <div class="dl_box" id="payment" style="display:block">
                    <p>
                        <!--<input type="radio" class="radio" name="pay_type" id="pay_type_0" value="0"  isCod="1" style="vertical-align:middle" /><label for="pay_type_0">货到付款 [<span id="pay_type_1_price">￥<span>0.00</span></span>]</label>-->
                        <input type="radio" class="radio" name="pay_type" id="pay_type_1" value="1" checked="checked" isCod="1" style="vertical-align:middle" /><label for="pay_type_1">微信支付 [<span id="pay_type_2_price">￥<span>0.00</span></span>]</label>
                    </p>
                </div>

                <!--<dl class="b_no" style="line-height: 40px;">-->
                    <!--<dd class="dd1">是否开票</dd>-->
                    <!--<span class="modRadio fr" style="margin-top: 10px;">-->
                    <!--<i class="fl"></i>-->
                        <!--<ins>否</ins>-->
                     <!--</span>-->
                <!--</dl>-->
                <div class="dl_box" id="inviype_box" style="margin-bottom:0.5rem; display:none;">

                </div>
            </div>
        </section>
        <div class="blank3"> </div>



        <section class="order_box padd1 radius10" style="padding-top:0.3rem;padding-bottom:0.3rem;">
            <div class="table_box table_box3" style=" margin-bottom:0.5rem">
                <div class="dl_box">
                    <dl>
                        <dd class="c333">
                            留言备注
                        </dd>
                        <dd >
                            <!--<input placeholder="请输入订单备注" name="note" type="text"   size="20"  />-->
                        </dd>
                    </dl>
                    <dl>

                        <textarea name="note" rows="3" placeholder="请输入订单备注" style="width: 100%;  resize:none; overflow:hidden; padding: 0 20px;    box-sizing: border-box;"></textarea>
                    </dl>
                </div>
            </div>
        </section>
        <div class="blank3"></div>
        <section class="order_box padd1 radius10" style="padding-top:0;padding-bottom:0;">
            <div class="table_box table_box3">
                <dl>
                    <dd >商品列表<a href="{:U('Cart/index')}" class="modify radius5">修改</a></dd>
                </dl>

                <div class="buyer" style="border:0;">
                    <volist name="carts" id="cart">
                        <div class="good good-bg" style="background: #fff;">
                            <img src="http://{:C('DOMAIN')}{:get_item_imgs($cart['goods']['multimage'],1,'path')['path']}" />
                            <div class="good-data">
                                <p>{$cart.goods.title}</p>
                                <!--<p class="color-red">发货时间：付款后7天发货</p>-->
                                <if condition="$cart['activity'] gt 0">
                                    <p class="color-red">￥{$cart.price} <span class="fr">X{$cart.number}</span></p>
                                    <p class="color-good"><s>￥{$cart.goods.price} </s></p>
                                    <else/>
                                    <p class="color-red">￥{$cart.goods.price} <span class="fr">X{$cart.number}</span></p>
                                </if>

                                {:hook("order_goods_confirm",$cart["tags"])}
                            </div>
                        </div>
                        <input type="text" hidden="hidden" name="cart_id[]" value="{$cart.id}">
                        <input type="text" hidden="hidden" name="goods_id" value="{$cart.goods.id}">
                    </volist>
                    <ul class="order-bottom" style="margin-top: 0px;">
                        <li class="noboder">共计{:count($carts)}件商品合计 <span class="size color-red fr"> ￥{$total}</span></li>
                        <li>应付金额 <span class="size color-red fr"> ￥<span id="total">{$total}</span></span></li>
                    </ul>
                </div>
            </div>
        </section>
        <div class="blank3"></div>
        <div  style="width:94%;margin-left:3%;"><input id="submit" type="submit"   value="提交订单" class="c-btn3" /></div>
        <input type="hidden" name="address_id" value="{$address.id}" />
    </form>
</section>
<script>
    $(function(){
        $("#submit").on('click',function(){
            //check address
            var address_id = $("input[name=address_id]").val();
            if(!(address_id>0)){
                alert("地址为空");
                return false;
            }

            //check goods
            var goods_id = $("input[name=goods_id]").val();
            if(!(goods_id>0)){
                alert("商品为空");
                return false;
            }

            //check maney to pay

            //check total maney
            var total = $("#total").text();
            if(!(total>0)){
                alert("应付金额为0");
                return false;
            }
            return true;
        });
    });
</script>




<div class="blank3"></div>

</body>
</html>
